package hibernate;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class PLanguages implements Serializable{
	
	@Column(name = "PROGRAM_NAME")
	private String programName;

	@Column(name = "GRADE")
	private int grade;

	public String getProgramName() {
		return programName;
	}

	public int getLevel() {
		return grade;
	}

	public void setProgramName(String programName) {
		this.programName = programName;
	}

	public void setLevel(int level) {
		this.grade = level;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + grade;
		result = prime * result
				+ ((programName == null) ? 0 : programName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PLanguages other = (PLanguages) obj;
		if (grade != other.grade)
			return false;
		if (programName == null) {
			if (other.programName != null)
				return false;
		} else if (!programName.equals(other.programName))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "PLanguages [programName=" + programName + ", level=" + grade
				+ "]";
	}

	
}
